Skip to content

linux: fix 'TLS PSK derivation fixes'#1042

Closed
hreinecke wants to merge 1 commit intolinux-nvme:masterfrom
hreinecke:psk-derivation-fixes-2
Closed

linux: fix 'TLS PSK derivation fixes'#1042
hreinecke wants to merge 1 commit intolinux-nvme:masterfrom
hreinecke:psk-derivation-fixes-2

Conversation

@hreinecke
Copy link
Copy Markdown
Collaborator

The patch 'TLS PSK derivation fixes' was a bit too eager in adding the 'length' field to the HKDF label.
The NVMe TCP spec defines

Retained PSK = HKDF-Expand-Label(PRK, “HostNQN”, NQNh, Length(Configured PSK))

which according to RFC 8446 translates to:

HKDF-Expand(PRK, HkdfLabel, Length(Configured PSK))

and

HkdfLabel {
(u16) Length(Configured PSK)
"tls13 HostNQN"
NQNh
}

The previous patch would tread both the 'label' and the 'context' field as an HkdfLabel, which is wrong.

The patch 'TLS PSK derivation fixes' was a bit too eager in adding
the 'length' field to the HKDF label.
The NVMe TCP spec defines

Retained PSK = HKDF-Expand-Label(PRK, “HostNQN”, NQNh, Length(Configured PSK))

which according to RFC 8446 translates to:

HKDF-Expand(PRK, HkdfLabel, Length(Configured PSK))

and

HkdfLabel {
  (u16) Length(Configured PSK)
  "tls13 HostNQN"
  NQNh
}

The previous patch would tread both the 'label' and the 'context' field
as an HkdfLabel, which is wrong.

Signed-off-by: Hannes Reinecke <[email protected]>
@hreinecke
Copy link
Copy Markdown
Collaborator Author

Original patch had been reverted, so close.

@hreinecke hreinecke closed this Jul 25, 2025
@hreinecke hreinecke deleted the psk-derivation-fixes-2 branch September 4, 2025 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant